﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Session["CadenaDeConexion"] = ConfigurationManager.ConnectionStrings["SIG"].ConnectionString;
    }
    protected void LinkButtonAddNew_Click(object sender, EventArgs e)
    {
        this.FormView1.Visible = true;
        this.FormView1.ChangeMode(FormViewMode.Insert);
    }
    protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
    {
        limpiarformulario();
    }
    protected void InsertCancelButton_Click(object sender, EventArgs e)
    {
        limpiarformulario();
    }
    private void limpiarformulario()
    {
        this.FormView1.Controls.Clear();
        this.FormView1.Visible = false;
        this.FormView1.ChangeMode(FormViewMode.ReadOnly);
    }

    protected void ObjectDataSourceIngrediente_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
    {
        Label1.Text = e.OutputParameters["mensaje"].ToString();
    }
}
